package 线程课后习题;

class Second extends Thread {
	
	@Override
	public void run() {
		System.out.println("子线程名："+Thread.currentThread().getName()
				+ ",优先级"+Thread.currentThread().getPriority());
	}
}

public class Test4 {
	public static void main(String[] args) {
		Thread t=Thread.currentThread();//注意  主线程的引用
		t.setPriority(Thread.MAX_PRIORITY);
		System.out.println("主线程名："+Thread.currentThread().getName()+",优先级"+t.getPriority());
		Second s=new Second();
		s.setPriority(Thread.MIN_PRIORITY);
		s.start();
	}
}
